Make image-compute-scaling-factor argument optional
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 9 Nov 2021 04:55:32 +0000 (05:55 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 9 Nov 2021 04:55:32 +0000 (05:55 +0100)
* lisp/image.el (image-compute-scaling-factor): Make the argument
optional.

lisp/image.el

index 4815f0094907b3dce4e5dd7faeae2e1400a41af2..a149caa1a973ce8bfba414b783970bee28e6e213 100644 (file)
@@ -559,7 +559,12 @@ If VALUE is nil, PROPERTY is removed from IMAGE."
   (declare (gv-setter image--set-property))
   (plist-get (cdr image) property))
 
-(defun image-compute-scaling-factor (scaling)
+(defun image-compute-scaling-factor (&optional scaling)
+  "Compute the scaling factor based on SCALING.
+If a number, use that.  If it's `auto', compute the factor.
+If nil, use the `image-scaling-factor' variable."
+  (unless scaling
+    (setq scaling image-scaling-factor))
   (cond
    ((numberp scaling) scaling)
    ((eq scaling 'auto)